package com.yihusitian.zsxq.pojo.data;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

import java.util.Date;

/**
 * @Description TODO
 * @Author LeeHo
 * @Date 2021-03-25 11:49:28
 */
@Data
@Builder
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_topic")
public class TopicDO extends Model<TopicDO> implements Serializable {

	private static final long serialVersionUID = 2958582649095088390L;

	//主键
	@TableId(value = TopicColumn.ID)
	private Long id;
	
	//类型
	@TableField(value = TopicColumn.TYPE, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private String type;
	
	//组id
	@TableField(value = TopicColumn.GROUP_ID, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Long groupId;
	
	//讨论id
	@TableField(value = TopicColumn.TALK_ID, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Long talkId;
	
	//点赞数量
	@TableField(value = TopicColumn.LIKE_COUNT, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Integer likeCount;
	
	//奖励数量
	@TableField(value = TopicColumn.REWARDS_COUNT, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Integer rewardsCount;
	
	//评论数量
	@TableField(value = TopicColumn.COMMENTS_COUNT, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Integer commentsCount;
	
	//已读数量
	@TableField(value = TopicColumn.READING_COUNT, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Integer readingCount;
	
	//读者数量
	@TableField(value = TopicColumn.READERS_COUNT, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Integer readersCount;
	
	//创建时间
	@TableField(value = TopicColumn.CREATE_TIME, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Date createTime;
	
	//更新时间
	@TableField(value = TopicColumn.MODIFY_TIME, insertStrategy = FieldStrategy.NOT_NULL, updateStrategy = FieldStrategy.NOT_NULL)
	private Date modifyTime;
	
	@Override
    protected Serializable pkVal() {
        return id;
    }
	
	public class TopicColumn{
		public static final String ID = "id";
		public static final String TYPE = "type";
		public static final String GROUP_ID = "group_id";
		public static final String TALK_ID = "talk_id";
		public static final String LIKE_COUNT = "like_count";
		public static final String REWARDS_COUNT = "rewards_count";
		public static final String COMMENTS_COUNT = "comments_count";
		public static final String READING_COUNT = "reading_count";
		public static final String READERS_COUNT = "readers_count";
		public static final String CREATE_TIME = "create_time";
		public static final String MODIFY_TIME = "modify_time";
	}
}